package com.hopu.v1.pojo.exam;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hopu.v1.pojo.common.Delete;
import com.hopu.v1.pojo.common.Save;
import com.hopu.v1.pojo.common.Update;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 考试成绩表
 * @TableName t_exam_grades
 */
@TableName(value ="t_exam_grades")
@Data
public class ExamGrades implements Serializable {
    /**
     * 成绩唯一标识
     */
    @NotNull(message = "id不能为空", groups = {Delete.class, Update.class})
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 学生唯一标识
     */
    @NotNull(message = "学生不能为空", groups = {Save.class, Update.class})
    private Integer studentId;

    /**
     * 考试记录唯一标识
     */
    @NotNull(message = "考试记录不能为空", groups = {Save.class, Update.class})
    private Integer examRecordId;

    /**
     * 考试题目唯一标识
     */
    @NotNull(message = "考试题目不能为空", groups = {Save.class, Update.class})
    private Integer questionId;

    /**
     * 学生答案
     */
    @NotBlank(message = "学生答案不能为空", groups = {Save.class, Update.class})
    private String studentAnswer;

    /**
     * 得分
     */
    @NotNull(message = "得分不能为空", groups = {Save.class, Update.class})
    private Integer score;

    /**
     * 创建人
     */
    private String createBy;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * 修改人
     */
    private String updateBy;

    /**
     * 修改时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 学生选择的选项
     */
    @TableField(exist = false)
    private  String studentOption;
}